<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        function searchDurgPrice(type) {
            var form=$("#searchForm");
          if(type==1){
              form.attr("onsubmit","return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expPrice/query');")
          }else{
              form.attr("onsubmit","return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expPrice/query1');")
          }
            form.submit();
        }

</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/csm/expPrice/query?expInfo.expDict.expNameDict.expCode=${expPrice.expInfo.expDict.expNameDict.expCode}')">消耗品价格列表</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="expPrice"  onsubmit="" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label >消耗品类别:</label>
                                        <sys:treeselect selectedParent="false" id="expType" name="expType" value="${expPrice.expInfo.expDict.expNameDict.expType}"
                                                        update="${not empty expPrice.expInfo.expDict.expNameDict.id}" labelName="expPrice.expInfo.expDict.expNameDict.expClassDict.className"
                                                        labelValue="${expPrice.expInfo.expDict.expNameDict.expClassDict.className}"
                                                        title="消耗品类别"
                                                        url="/csm/expClassDict/treeData" extId="${expPrice.expInfo.expDict.expNameDict.id}" cssClass="form-control"/>
                                    &nbsp;&nbsp;<label>消耗品名称 ：</label><form:input path="expInfo.expDict.expName" htmlEscape="false" maxlength="50" class="form-control" />
                                    <input id="btnSubmit" class="btn btn-primary" type="button" value="现行价格查询" onclick="searchDurgPrice(1)"/>
                                    <input id="btnSubmit" class="btn btn-primary" type="button" value="历史价格查询" onclick="searchDurgPrice(2)"/>
                                </form:form>

                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                            <thead>
                                <tr>
                                    <%--<th>消耗品代码</th>--%>
                                    <th>消耗品名称</th>
                                    <th>消耗品包装规格</th>
                                    <th>消耗品单位</th>
                                    <th>厂家标识</th>
                                    <th>最小单位规格</th>
                                    <th>最小单位</th>
                                    <th>开始日期</th>
                                    <th>结束日期</th>
                                    <th>市场批发价/元</th>
                                    <th>市场零售价/元</th>
                                    <th>费用分类</th>
                                    <th>核算项目分类</th>
                                    <th>会计科目</th>
                                    <th>病案首页分类</th>
                                    <th>最高限价/元</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="expPrice">
                                <tr>
                                    <%--<td> ${expPrice.expInfo.expDict.expNameDict.expCode}</td>--%>
                                    <td> ${expPrice.expInfo.expDict.expNameDict.expName}</td>
                                    <td> ${expPrice.packageSpec}</td>
                                    <td> ${fns:getDictLabels(expPrice.units, 'SPEC_UNIT', '')}</td>
                                    <td> ${expPrice.expInfo.expSupplierCata.supplierName}</td>
                                    <td> ${expPrice.expInfo.minSpec}</td>
                                    <td> ${fns:getDictLabels(expPrice.expInfo.minUnits, 'SPEC_UNIT', '')}</td>
                                    <td> <fmt:formatDate value="${expPrice.startDate}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                                    <td> <fmt:formatDate value="${expPrice.stopDate}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                                    <td> ${expPrice.tradePrice}</td>
                                    <td> ${expPrice.retailPrice}</td>
                                    <td> ${fns:getDictLabels(expPrice.classOnRcpt, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(expPrice.classOnReckoning, 'RECK_ITEM_CLASS_DICT', '')}</td>
                                    <td> ${fns:getDictLabels(expPrice.subjCode, 'TALLY_SUBJECT_DICT', '')}</td>
                                    <td> ${expPrice.classOnMr}</td>
                                    <td> ${expPrice.priceMax}</td>
                                </tr>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>